package com.tang.logger.config;

import lombok.Data;

/**
 * @author Tang
 * @classname LogPusherProperties
 * @description [  ]
 * @date 2021/7/25 11:20
 */
@Data
public class LogPusherProperties {

    public static final String PREFIX = "log.pusher";

    /**
     * 日志中设置filter
     */
    private boolean enable = true;

    /**
     * 数据库配置
     */
    private final DatabaseProperties database = new DatabaseProperties();

    /**
     * websocket 配置
     */
    private final WebSocketProperties webSocket = new WebSocketProperties();

    @Data
    public static class DatabaseProperties {

        /**
         * 表名
         */
        private String tableName = "t_log";

        /**
         * 缓冲器大小
         */
        private int bufferSize = 100;

        /**
         * 是否允许有多个
         */
        private boolean allowMulti = false;

    }

    @Data
    public static class WebSocketProperties{

        private String endPoint = "/websocket";

        private String destination = "/log";

    }


}